home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 3 / ct-rom iiib.zip / ct-rom iiib / WINDOWS / DIVERSEN / WINE02BX / AUTO-SAV.ELC < prev    next >
Text File  |  1993-03-28  |  8KB  |  121 lines

  1. ;;; compiled by jwz@thalidomide on Tue Aug 18 17:18:05 1992
  2. ;;; from file /u/jwz/emacs19/lisp/packages/auto-save.el
  3. ;;; emacs version 19.2.2 Lucid.
  4. ;;; bytecomp version 2.08;  2-aug-92.
  5. ;;; optimization is on.
  6. ;;; this file uses opcodes which do not exist in Emacs18.
  7.  
  8. (if (and (boundp 'emacs-version)
  9.      (or (and (boundp 'epoch::version) epoch::version)
  10.          (string-lessp emacs-version "19")))
  11.     (error "This file was compiled for Emacs19."))
  12.  
  13. (byte-code "└┬ç" ["cvs ate me" auto-save-version nil] 1)
  14. (defvar auto-save-directory nil "\
  15. If non-nil, fixed directory for autosaving: all autosave files go
  16. there.  If this directory does not yet exist at load time, it is
  17. created and its mode is set to 0700 so that nobody else can read your
  18. autosave files.
  19.  
  20. If nil, each autosave files goes into the same directory as its
  21. corresponding visited file.
  22.  
  23. A non-nil `auto-save-directory' could be on a local disk such as in
  24. /tmp, then auto-saves will always be fast, even if NFS or the
  25. automounter is slow.  In the usual case of /tmp being locally mounted,
  26. note that if you run emacs on two different machines, they will not
  27. see each other's auto-save files.
  28.  
  29. The value (expand-file-name \"~/autosave/\") might be better if /tmp
  30. is mounted from swap (possible in SunOS, type `df /tmp' to find out)
  31. and thus vanishes after a reboot, or if your system is particularly
  32. thorough when cleaning up /tmp, clearing even non-empty subdirectories.
  33.  
  34. It should never be an ange-ftp remote filename because that would
  35. defeat `ange-ftp-auto-save-remotely'.
  36.  
  37. Unless you set `auto-save-hash-p', you shouldn't set this to a
  38. directory in a filesystem that does not support long filenames, since
  39. a file named
  40.  
  41.     /home/sk/lib/emacs/lisp/auto-save.el
  42.  
  43. will have a longish filename like
  44.  
  45.     AUTO-SAVE-DIRECTORY/#\\!home\\!sk\\!lib\\!emacs\\!lisp\\!auto-save.el#
  46.  
  47. as auto save file.
  48.  
  49. See also variables `auto-save-directory-fallback', `auto-save-hash-p',
  50. `ange-ftp-auto-save' and `ange-ftp-auto-save-remotely'.")
  51. (defvar auto-save-hash-p nil "\
  52. If non-nil, hashed autosave names of length 14 are used.
  53. This is to avoid autosave filenames longer than 14 characters.
  54. The directory used is `auto-save-hash-directory' regardless of
  55. `auto-save-directory'.
  56. Hashing defeats `recover-all-files', you have to recover files
  57. individually by doing `recover-file'.")
  58. (defvar ange-ftp-auto-save 0 "\
  59. If 1, allows ange-ftp files to be auto-saved.
  60. If 0, suppresses auto-saving of ange-ftp files.
  61. Don't use any other value.")
  62. (defvar ange-ftp-auto-save-remotely nil "\
  63. *If non-nil, causes the auto-save file for an ange-ftp file to be written in
  64. the remote directory containing the file, rather than in a local directory.
  65.  
  66. For remote files, this being true overrides a non-nil
  67. `auto-save-directory'.  Local files are unaffected.
  68.  
  69. If you want to use this feature, you probably only want to set this
  70. true in a few buffers, rather than globally.  You might want to give
  71. each buffer its own value using `make-variable-buffer-local'.
  72.  
  73. See also variable `ange-ftp-auto-save'.")
  74. (defvar auto-save-directory-fallback (expand-file-name "~/autosave/") "\
  75. Directory used for local autosaving of remote files if
  76. both `auto-save-directory' and `ange-ftp-auto-save-remotely' are nil.
  77. Also used if a working directory to be used for autosaving is not writable.
  78. This *must* always be the name of directory that exists or can be
  79. created by you, never nil.")
  80. (defvar auto-save-hash-directory (byte-code "└┴\n«ü \"ç" [expand-file-name "hash/" auto-save-directory auto-save-directory-fallback] 3) "\
  81. If non-nil, directory used for hashed autosave filenames.")
  82. (byte-code "└┴Mê┬└├\"ê ½ä└┼!ê└ç" [auto-save-check-directory #[(var) "Jë??¡⌐┬    !ëLê├    !?¡¢─    !┼╞!½å╞    !ê¬ê╟╚╔ëë    %ê╩    ╦\")ç" [var dir expand-file-name file-directory-p directory-file-name fboundp make-directory call-process "mkdir" nil set-file-modes 448] 7] mapcar (auto-save-directory auto-save-directory-fallback) auto-save-hash-p auto-save-hash-directory] 3)
  83. (fset 'make-auto-save-file-name #[nil "└┴┬Åç" [error-data (byte-code "└┴!½â    «ü\në?¡â─┼! «ä╟╚ !     ;¡ê╩╦!¡â╦ ! ═ ½É½å╧    !¬£╨    !¬û¼ä½ê╨    \"¬å╧    \"!,ç" [boundp buffer-file-truename buffer-file-name file-name make-temp-name "#%" name-prefix auto-save-unslashify-name buffer-name save-name fboundp ange-ftp-ftp-path remote-p expand-file-name ange-ftp-auto-save-remotely auto-save-name-in-same-directory auto-save-name-in-fixed-directory auto-save-directory auto-save-hash-p] 5) ((error (byte-code "└┴\n\"ê├─!ê½è╞!╟╚!╟Rç╔╩╦ ╟Q!ç" [message "make-auto-save-file-name %s" error-data sit-for 2 buffer-file-name file-name-directory "#" file-name-nondirectory expand-file-name "#%" buffer-name] 4)))] 3 "\
  84. Return file name to use for auto-saves of current buffer.
  85. Does not consider `auto-save-visited-file-name'; that is checked
  86. before calling this function.
  87.  
  88. Offers to autosave all files in the same `auto-save-directory'.  All
  89. autosave files can then be recovered at once with function
  90. `recover-all-files'.
  91.  
  92. Takes care to make autosave files for files accessed through ange-ftp
  93. be local files if variable `ange-ftp-auto-save-remotely' is nil.
  94.  
  95. Takes care of slashes in buffer names to prevent autosave errors.
  96.  
  97. Takes care that autosave files for buffers not visiting any file (such
  98. as `*mail*') from two simultaneous Emacses don't collide by prepending
  99. the Emacs pid.
  100.  
  101. Uses 14 character autosave names if `auto-save-hash-p' is true.
  102.  
  103. Autosaves even if the current directory is not writable, using
  104. directory `auto-save-directory-fallback'.
  105.  
  106. You can redefine this for customization (he he :-).
  107. See also function `auto-save-file-name-p'."])
  108. (fset 'auto-save-original-name #[(savename) "└    !┬    !┼ !½å╞╟ \"½â╚¬Ü     Ü¼å \nܽê╦ ╠═O!¬å ╠═OP*ç" [file-name-nondirectory savename file-name-directory savedir basename auto-save-file-name-p string-match "^#%" nil auto-save-directory auto-save-directory-fallback auto-save-slashify-name 1 -1] 4 "\
  109. Reverse of `make-auto-save-file-name'.
  110. Returns nil if SAVENAME was not associated with a file (e.g., it came
  111. from an autosaved `*mail*' buffer) or does not appear to be an
  112. autosave file at all.
  113. Hashed files are not understood, see `auto-save-hash-p'."])
  114. (byte-code "└┴Mê┬├Mê─┼Mê╞╟Mê╚╔Mç" [auto-save-name-in-fixed-directory #[(filename &optional prefix) "«ü┴┬ !┴Q½ô½Å G╟V½ë╚╔ !\"¬ë╚ \n«é \")ç" [prefix "#" auto-save-unslashify-name filename base-name auto-save-hash-p auto-save-hash-directory 14 expand-file-name auto-save-cyclic-hash-14 auto-save-directory auto-save-directory-fallback] 3] auto-save-name-in-same-directory #[(filename &optional prefix) "└    !ë½ç├\n!¼é \n«ü╞╟    !╞R)ç" [file-name-directory filename directory file-writable-p auto-save-directory-fallback prefix "#" file-name-nondirectory] 5] auto-save-unslashify-name #[(s) "└┬├     #½á └ëöO └ö└òO┼ÿ½â╞¬ü╟ └ò╚OQ└òT¬Y) ç" [0 limit string-match "[/\\]" s "/" "\\!" "\\\\" nil] 5] auto-save-slashify-name #[(s) "└┬├     #ë½¥ ┼    O     TH╞=½â╟¬ü╚     ╔\\└OQ    T¬Z) ç" [nil pos string-match "\\\\[\\!]" s 0 33 "/" "\\" 2] 5] auto-save-cyclic-hash-14 #[(s) "└┴┬\"├╞╟\"ê╔╩┬H╦H╠H═H╬H╧H╨H╤H&    ë*ç" [make-string 8 0 nil result crc mapcar #[(new) "    ┬H\\    ┬    ├HIê    ├    ─H\\Iê    ─    ┼HIê    ┼    ╞HIê    ╞    ╟H\\Iê    ╟    ╚HIê    ╚    ╔HIê    ╔Iç" [new crc 7 6 5 4 3 2 1 0] 4] s format "%02x%02x%02x%02x%02x%02x%02x" 1 2 3 4 5 6 7] 12]] 2)
  115. (fset 'recover-all-files #[nil "└    ┬├#─ë┼ë    \n     ܼî╠\n└ ┬├#\"\n\n½√\n@    ═    !\nA\n½h╬    \"¼î╧╨    \"ê╤╥!ê¬TT╙É╘╒──╫    &æê╪┘┌\"!½5p▄┬\"q─▀ êα    ─\"êß─!ê─\"T╧πΣ \"êqê╤σ!ê+¬┼U½å╧µ!ê¬Æ╧τσU½âΦ¬üΘ$ê-Ω╙!¡âδ╙!ç" [directory-files auto-save-directory t "^#" nil 0 count total file afile savefiles auto-save-directory-fallback append auto-save-original-name file-newer-than-file-p message "autosave file \"%s\" is not current." sit-for 2 "*Directory*" call-process "ls" standard-output "-l" yes-or-no-p format "Recover %s from auto save file? " obuf find-file-noselect buf buffer-read-only erase-buffer insert-file-contents after-find-file buffer-auto-save-file-name "Auto-save off in buffer \"%s\" till you do M-x auto-save-mode." buffer-name 1 "Nothing to recover." "%d/%d file%s recovered." "" "s" get-buffer kill-buffer] 9 "\
  116. Do recover-file for all autosave files which are current.
  117. Only works if you have a non-nil `auto-save-directory'.
  118. Hashed files (see `auto-save-hash-p') are not understood, use
  119. `recover-file' to recover them individually." nil])
  120. (provide 'auto-save)
  121.